package com.ss.android.article.common.c;

import android.os.Build;

import com.bytedance.common.utility.Logger;
import com.ss.android.common.util.ToolUtils;
import com.ss.android.f.c.b;

public final class a {
    private static final String a;
    private static final b b;
    private static String c;
    private static String d;

    static {
        String v0;
        a = String.valueOf(Build.VERSION.SDK);
        b = new b();
        c = a;
        if(ToolUtils.isMiui()) {
            v0 = "miui_" + b.a("ro.miui.ui.version.name") + "_" + Build.VERSION.INCREMENTAL.toLowerCase();
        }
        else {
            v0 = b.a("ro.vivo.os.build.display.id");
            int v0_1 = (android.support.design.a.isTextEmpty(v0)) || !v0.toLowerCase().contains("funtouch") ? 0 : 1;
            if(v0_1 != 0) {
                v0 = b.a("ro.vivo.os.build.display.id") + "_" + b.a("ro.vivo.product.version").toLowerCase();
            }else if(b()) {
                if(b()) {
                    v0 = "coloros_" + b.a("ro.build.version.opporom") + "_" + Build.DISPLAY.toLowerCase();
                }else {
                    v0 = a;
                }
            }else if(c()) {
                if(android.support.design.a.isTextEmpty(d)) {
                    d = b.a("ro.build.version.emui");
                }

                v0 = d + "_" + Build.DISPLAY.toLowerCase();
                if(!android.support.design.a.isTextEmpty(v0)) {
                    v0 = v0.toLowerCase();
                }else {
                    v0 = a;
                }
            }else {
                v0 = a;
            }
        }

    label_23:
        if(android.support.design.a.isTextEmpty(v0)) {
            v0 = a;
        }
        c = v0;
    }

    public static String a() {
        return c;
    }

    private static boolean b() {
        String v0 = Build.MANUFACTURER;
        boolean v0_1 = !android.support.design.a.isTextEmpty(v0) ? v0.toLowerCase().contains("oppo") : false;
        return v0_1;
    }

    private static boolean c() {
        boolean v0 = false;
        boolean v1_2 = false;
        try {
            String v1_1 = b.a("ro.build.version.emui");
            d = v1_1;
            v1_2 = android.support.design.a.isTextEmpty(v1_1);
            if (!v1_2) {
                d = d.toLowerCase();
            }
        } catch (Exception v1) {
            Logger.ee(v1.getMessage());
            return v0;
        }

        if (!v1_2) {
            v0 = true;
        }

        return v0;
    }
}

